textcount text-box-name

Reports the number of lines in the current text box. Lines are delimited by carriage returns (they are logical lines, not physical lines). Empty lines are taken into account but not carriage returns at the end of the text. The number that textcount reports is the maximum number that can be used with textitem. See textitem.

Example:

If you have this text box on the page:

Seymour
The Queen of England
President Lincoln

show textcount "text1
3             Text1 contains 3 lines.

The following example takes a column of numbers in Text1 and prints the square of each number in Text2.

to square
text2,
do.one 1
end

to do.one :n
local "number
if :n > textcount "text1 [stop]
make "number textitem :n "text1
print :number * :number 
do.one :n + 1
end